document.addEventListener('DOMContentLoaded', function() {
    // 设置底部导航点击事件
    const navItems = document.querySelectorAll('.nav-item');
    navItems.forEach(item => {
        item.addEventListener('click', function() {
            const type = this.querySelector('span').textContent;
            switch(type) {
                case '医疗':
                    window.location.href = 'index.html';
                    break;
                case '知识':
                    window.location.href = 'knowledge.html';
                    break;
                case '档案':
                    window.location.href = 'records.html';
                    break;
                case '我的':
                    window.location.href = 'profile.html';
                    break;
            }
        });
    });

    // 设置档案项点击事件
    const recordItems = document.querySelectorAll('.record-item');
    recordItems.forEach(item => {
        item.addEventListener('click', function() {
            // 这里可以添加具体每个档案项的点击处理
            const type = this.querySelector('span').textContent;
            console.log('点击了：' + type);
            // TODO: 根据实际需求跳转到相应的详情页面
        });
    });

    // 页面加载时的渐入效果
    document.body.style.opacity = 0;
    setTimeout(() => {
        document.body.style.transition = 'opacity 0.3s ease-in';
        document.body.style.opacity = 1;
    }, 0);
}); 